#!/bin/bash

# 定义菜单项和价格（人民币）
meat1=8.6  # 宫保鸡丁
meat2=2.5  # 鱼香肉丝
vege1=5.5  # 豆芽炒青菜
vege2=1.9  # 椒盐蘑菇

# 菜名
meat1_name="宫保鸡丁"
meat2_name="鱼香肉丝"
vege1_name="豆芽炒青菜"
vege2_name="椒盐蘑菇"

# 汇率：人民币 -> 美元
exchange_rate=6.798

# 找到最便宜的荤菜
min_meat_price=$(echo "$meat1 $meat2" | awk '{if ($1 < $2) print $1; else print $2}')
if [ "$min_meat_price" == "$meat1" ]; then
  min_meat_name=$meat1_name
else
  min_meat_name=$meat2_name
fi

# 找到最便宜的素菜
min_vege_price=$(echo "$vege1 $vege2" | awk '{if ($1 < $2) print $1; else print $2}')
if [ "$min_vege_price" == "$vege1" ]; then
  min_vege_name=$vege1_name
else
  min_vege_name=$vege2_name
fi

# 计算最低消费（人民币）
min_rmb=$(echo "$min_meat_price $min_vege_price" | awk '{print $1 + $2}')

# 转换为美元并保留两位小数
min_usd=$(echo "$min_rmb" | awk -v exchange_rate=$exchange_rate '{printf "%.2f", $1 / exchange_rate}')

# 输出结果
echo "最低消费（人民币）：$min_rmb 元"
echo "最低消费（美元）：$min_usd 美元"
echo "搭配的菜品：$min_meat_name 和 $min_vege_name"
